﻿using Common;
using DAL.Origins;
using Model.CodeManage;
using Model.Origins;
using Model.Sys;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL.Origins
{
    /// <summary>
    /// 溯源模板处理类
    /// </summary>
    public class OriginsTempletBLL
    {
        OriginsTempletDAL dal = new OriginsTempletDAL();
        public List<OriginsTempletModel> GetList(string strWhere, string temp)
        {
            return dal.GetList(strWhere, temp);
        }

        /// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="productModel"></param>
        /// <returns></returns>
        public ResultEntity SaveData(string Content, string title,string imgUrl, SysUserModel userModel)
        {
            return dal.SaveData(Content, title,imgUrl, userModel);
        }

        /// <summary>
        /// 根据主键编号获取实体类信息
        /// </summary>
        /// <returns></returns>
        public OriginsTempletModel GetModelById(int tempId)
        {
            OriginsTempletModel model = new OriginsTempletModel();

            return dal.GetModelById(tempId);
        }
        public int UpdateDigitcode(BindCodeModel model)
        {
            return dal.UpdateDigitcode(model);

        }
        public int UpdateDigitcode0(BindCodeModel model)
        {
            return dal.UpdateDigitcode0(model);
        }
        public int GetNewId()
        {
            return dal.GetNewId();
        }
        public int UpdateTempletById(int templetId, string content, string title, string imgUrl)
        {
            return dal.UpdateTempletById(templetId, content, title, imgUrl);
        }
        public DataTable GetTempletById(int templetId)
        {
            return dal.GetTempletById(templetId);
        }
    }
}
